/*
 * @Author: 蔡科 caikeps@163.com
 * @Date: 2024-03-16 14:26:56
 * @LastEditors: 蔡科 caikeps@163.com
 * @LastEditTime: 2024-03-16 14:27:15
 * @FilePath: /ai-center-server/src/utils/tool.ts
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%A
 * E
 */
import fs from "fs";
export const readFile = (path: string): Promise<any> => {
    return new Promise((resolve, reject) => {
        fs.readFile(path, (error, data: Buffer) => {
            if (error) {
                console.error(error)
            } else {
                resolve(JSON.parse(data.toString()))
            }
        })
    })
}